<?php
class BaseController extends Yaf_Controller_Abstract
{
    public $session;
    public function init()
    {
    }
    public function mysql()
    {
        $arrConfig = Yaf_Registry::get('config');
        $option    = [
            'database_type' => 'mysql',
            'database_name' => $arrConfig->mysql->database,
            'server'        => $arrConfig->mysql->hostname,
            'username'      => $arrConfig->mysql->username,
            'password'      => $arrConfig->mysql->password,
            'charset'       => 'utf8',
            'port'          => 3306,
            'prefix'        => $arrConfig->mysql->prefix,

            'logging'       => true,

            'option'        => [
                PDO::ATTR_CASE => PDO::CASE_NATURAL,
            ],
            'command'       => [
                'SET SQL_MODE=ANSI_QUOTES',
            ],

        ];
        return new \Medoo\Medoo($option);
    }



}
